package org.springblade.tms.module.userinfo.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R;
import org.springblade.tms.module.userinfo.base.BindService;
import org.springblade.tms.module.userinfo.dto.BindDto;
import org.springblade.tms.module.userinfo.dto.NumberBindDto;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @projectName: BladeX
 * @package: org.springblade.tms.module.userinfo.controller
 * @className: BindController
 * @author: yr
 * @description: 绑定解绑接口
 * @date: 2022/3/10 16:41
 */
@RestController
@RequestMapping("userInfo/Bind")
@Api(value = "绑定解绑-yr", tags = "绑定解绑-yr")
public class BindController {
	@Resource
	private BindService bindService;

	/**
	 * @return
	 * @Desc 承运商绑定解绑车辆或司机或押运员
	 * @author yr
	 * @Date 2022/3/7
	 */
	@ApiLog("承运商绑定解绑车辆或司机或押运员")
	@PostMapping("/bindOrUnBind")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "承运商绑定解绑车辆或司机或押运员", notes = "bindDto")
	public R bindOrUnBind(@RequestBody BindDto bindDto) {
		return bindService.bindOrUnBind(bindDto);
	}

	/**
	 * @return
	 * @Desc 根据手机号给当前用户绑定车辆或司机或押运员
	 * @author yr
	 * @Date 2022/3/10
	 */
	@ApiLog("根据手机号给当前用户绑定车辆或司机或押运员")
	@PostMapping("/phoneBind")
	@ApiOperationSupport(order = 2)
	@ApiOperation(value = "根据手机号给当前用户绑定车辆或司机或押运员", notes = "phoneBindDto")
	public R phoneBind(@RequestBody NumberBindDto numberBindDto) {
		return bindService.phoneBind(numberBindDto);
	}

}
